package com.yunhe.merchants.repository;

import com.yunhe.merchants.model.DataPlanProjectCondition;
import org.apache.ibatis.annotations.Param;
import com.yunhe.merchants.domain.DataPlanProject;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 策划库
 * @author hetao
 * @date 2021/05/10
 */
@Repository
public interface IDataPlanProjectRepository {

    /**
     * 新增
     * @author hetao
     * @date 2021/05/10
     **/
    int createDataPlanProject(DataPlanProject dataPlanProject);

    /**
     * 新增
     * @author hetao
     * @date 2021/05/10
     **/
    int createDataPlanProjectSelective(DataPlanProject dataPlanProject);

    /**
     * 刪除
     * @author hetao
     * @date 2021/05/10
     **/
    int deleteDataPlanProjectByPrimaryKey(@Param("id") String id,@Param("updater") Long headerUser);

    /**
     * 更新
     * @author hetao
     * @date 2021/05/10
     **/
    int updateDataPlanProjectByPrimaryKey(DataPlanProject dataPlanProject);

    /**
     * 更新
     * @author hetao
     * @date 2021/05/10
     **/
    int updateDataPlanProjectByPrimaryKeySelective(DataPlanProject dataPlanProject);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/05/10
     **/
    DataPlanProject searchDataPlanProjectByPrimaryKey(@Param("id") String id);

    List<DataPlanProject> findPlanProjectByConditionWithOutKeyWords(DataPlanProjectCondition dataPlanProjectCondition);

    List<DataPlanProject> findPlanProjectByConditionWithCustTel(DataPlanProjectCondition dataPlanProjectCondition);

    List<DataPlanProject> findPlanProjectByConditionWithCustName(DataPlanProjectCondition dataPlanProjectCondition);

    List<DataPlanProject> findPlanProjectByConditionWithCompanyName(DataPlanProjectCondition dataPlanProjectCondition);

    void insertBatch(@Param("dataPlanProjects") List<DataPlanProject> dataPlanProjects);

    void updateDataPlanProject(@Param("ids") List<String> ids, @Param("companyStatus") String companyStatus,
                               @Param("deptId") Long deptId,
                               @Param("salesman") Long salesman, @Param("updateDate") Date updateDate,
                               @Param("userId") Long userId);


}
